//
//  TestProblem75.swift
//  LeetCodeTests
//
//  Created by 武侠 on 2023/6/25.
//  Copyright © 2023 zhulongiMac02. All rights reserved.
//

import XCTest
@testable import LeetCode

final class TestProblem75: XCTestCase {

    var problem = Problem75()
    
    override func setUp() {
        super.setUp()
        // Put setup code here. This method is called before the invocation of each test method in the class.
    }
    
    override func tearDown() {
        // Put teardown code here. This method is called after the invocation of each test method in the class.
        super.tearDown()
    }
    
    // MARK: - 排序
    func testProblem75_Case1() throws {
        var list = [2,0,2,1,1,0]
        problem.sortColors(&list)
        XCTAssertEqual(list, [0,0,1,1,2,2])
    }
    
    func testProblem75_Case2() throws {
        var list = [2,0,1]
        problem.sortColors(&list)
        XCTAssertEqual(list, [0,1,2])
    }
    
    func testProblem75_Case3() throws {
        var list = [0]
        problem.sortColors(&list)
        XCTAssertEqual(list, [0])
    }
    
    func testProblem75_Case4() throws {
        var list = [1]
        problem.sortColors(&list)
        XCTAssertEqual(list, [1])
    }
    
    func testProblem75_Case5() throws {
        var list = [2]
        problem.sortColors(&list)
        XCTAssertEqual(list, [2])
    }
    
    func testProblem75_2_Case1() throws {
        var list = [2,0,2,1,1,0]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [0,0,1,1,2,2])
    }
    
    func testProblem75_2_Case2() throws {
        var list = [2,0,1]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [0,1,2])
    }
    
    func testProblem75_2_Case3() throws {
        var list = [0]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [0])
    }
    
    func testProblem75_2_Case4() throws {
        var list = [1]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [1])
    }
    
    func testProblem75_2_Case5() throws {
        var list = [2]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [2])
    }
    
    func testProblem75_2_Case6() throws {
        var list = [1,2,0]
        problem.sortColors2(&list)
        XCTAssertEqual(list, [0,1,2])
    }
}
